package com.boang.math;

/*
  @author: 13813
  @date: 2024/11/22 11:45
*/
public class MathDemo {
    public static void main(String[] args) {
        for (int i = 0; i < 5; i++) {
            //随机数（0~1）
            double random = Math.random();
            System.out.println(random);
            System.out.println(random * 100);
            double floor = Math.floor(random * 100);//向下取整
            System.out.println("向下取整:" + (int) floor);
            double ceil = Math.ceil(random * 100);//向上取整
            System.out.println("向上取整:" + ceil);
        }

    }
}
